package com.example.base

import org.junit.Assert.assertEquals
import org.junit.Test

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {

    private fun log(arr: IntArray) {
        var result: IntArray = arr
        if (arr.size > 100) {
            val shorter = IntArray(100)
            System.arraycopy(arr, 0, shorter, 0, 100)
            result = shorter
        }
        log(result.contentToString())
    }

    private fun log(msg: String) {
        System.out.println(msg)
    }

    @Test
    fun addition_isCorrect() {
        assertEquals(4, 2 + 2)
    }


    @Test
    fun test1() {
        val arr = intArrayOf(5, 6, 4, 1, 2, 3, 2, 1, 0, 4, 9, 8, 7)
        SortStudy.quick(arr)
        log(arr)
    }
}